<?php $access = $obj->access; ?>
<div id="toolbar-box">
    <div class="toolbar" id="toolbar">
        <table class="toolbar">
            <tr>
                <?php if($access['allow_delete'] == true){ ?>
                    <td class="button" id="toolbar-trash">
                    <a href="#" onclick="delet('group');" class="toolbar">
                    <span class="icon-32-trash" title="Trash">
                    </span>
                    Видалити
                    </a>
                    </td>
                <?php } if($access['allow_edit'] == true){ ?>
                    <td class="button" id="toolbar-edit">
                    <a href="#" onclick="edit('group');" class="toolbar">
                    <span class="icon-32-edit" title="Edit">
                    </span>
                    Редагувати
                    </a>
                    </td>
                <?php } if($access['allow_write'] == true){ ?>
                    <td class="button" id="toolbar-new">
                    <a  href="/admin/addgroup.html" class="toolbar">
                    <span class="icon-32-new" title="New">
                    </span>
                    Створити
                    </a>
                    </td>
                <?php } ?>
            </tr>
        </table>
    </div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<table class="adminlist">
<thead>
    <tr>
        <td class="title" width='15px'></td>
        <td class="title">
            <strong>#</strong>
        </td>
        <td class="title">
            <strong>Назва</strong>
        </td>
        <td class="title" width="150px">
            <strong>Допуск до адмін панелі</strong>
        </td>
        <td class="title" width="50px">
            <strong>Редагувати</strong>
        </td>
        <td class="title" width="50px">
            <strong>Видалити</strong>
        </td>
    </tr>
</thead>
<tbody>
<?php
$i=1;
foreach($obj->groups as $value){
?>
<tr id='row<?=$value['id']?>'>
<td width='15px'>
   <?php if($access['allow_delete'] == true && $value['Rights']<5 || $value['Rights']>=5 && $access['allow_super'] == true){ ?>
        <input type="checkbox" id="checkme<?=$i?>" value="<?=$value['id']?>"/>
     <?php } ?>
</td>
<td width="5%"><?=$value['id']?></td>
<td><?=$value['role']?></td>
<td align="center">
    <?php if($value['cpanel']==1){ ?>
                    <img src="/public/images/admin/tick.png" border="0" alt="Включенен" alt='Включенен'/>
            <?php }else{ ?>
                    <img src="/public/images/admin/publish_x.png" border="0" alt="Отключен" alt='Отключен'/>
    <?php } ?>
</td>
<td align="center">
    <?php if($access['allow_edit'] == true && $value['Rights']<5 || $value['Rights']>=5 && $access['allow_super'] == true){ ?><a style='padding-left:5px;' href="/admin/groupedit.html?id=<?=$value['id']?>"><img src="/public/images/edit.png" border="0" width="16px" height="16px"></a><?php } ?>
</td>
<td align="center">
    <?php if($access['allow_delete'] == true && $value['Rights']<5 || $value['Rights']>=5 && $access['allow_super'] == true){ ?><span style='padding-left:5px;cursor:pointer;' id='del_group<?=$value['id']?>' onclick="actions(<?=$value['id']?>,'del_group');"><img src="/public/images/delete.jpg"  border="0" width="16px" height="16px"></span><?php } ?>
</td>
</tr>
<?php
$i++;}
?>
</tbody>
</table>
